package com.taptech.doufu.ui.fragment;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;

import com.taptech.doufu.app.WeMediaApplication;

import java.util.ArrayList;

import androidx.fragment.app.Fragment;

/**
 * DiaobaoBaseFragment
 */
public class DiaobaoBaseFragment extends Fragment {

    protected View rootView;
    private long onCreateTime = 0;


    public static ArrayList<Object> requestsResCache = new ArrayList<Object>();

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        onCreateTime = System.currentTimeMillis();
    }

    @Override
    public void onStop() {
        super.onStop();
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
        onCreateTime = 0;
    }

    public Context getContext() {
        if (getActivity() != null) {
            return getActivity();
        }
        return WeMediaApplication.applicationContext;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }


    public void onResume(String name, Context context) {
        super.onResume();
    }


    @Override
    public void onDestroyView() {
        if (rootView != null && rootView.getParent() != null) {
            ((ViewGroup) rootView.getParent()).removeView(rootView);
        }
        super.onDestroyView();
    }

}
